﻿using System.Data.Common;

namespace Unknown.Framework.Database
{
    /// <summary>
    /// 单值查询操作处理类
    /// </summary>
    public class ScalarOperationHandler : IOperationHandler
    {
        /// <summary>
        /// 结果
        /// </summary>
        public object Result { get; set; }

        /// <summary>
        /// 执行
        /// </summary>
        /// <param name="command">命令</param>
        public void Execute(DbCommand command)
        {
            if (command != null)
            {
                this.Result = command.ExecuteScalar();
            }
        }
    }
}
